import Cookies from 'js-cookie';

const getCookie = (key: string): string | undefined => {
    return Cookies.get(key);
}

const setCookie = (key: string, value: any, days: number): void => {
    Cookies.set(key, value, { expires: days });
}

const removeCookie = (key: string): void => {
    return Cookies.remove(key);
}

const getToken = (): string | undefined => {
    return getCookie('token');
}

const setToken = (token: string, days: number): void => {
    setCookie('token', token, days);
}

const removeToken = (): void => {
    removeCookie('token');
}

export { getCookie, setCookie, getToken, setToken, removeToken, removeCookie }